package com.start.admin.mappers;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.start.admin.entity.StartSysUserManageDept;
import com.start.admin.vo.StartSysUserManageDeptVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SysUserManageDeptMapper extends BaseMapper<StartSysUserManageDept> {
    String USER_MANAGE_DEPT_SQL="SELECT  " +
            "  ssum.*,  " +
            "  ssu.nick_name user_nick_name,  " +
            "  ssu.real_name user_real_name,  " +
            "  ssu.user_name   " +
            "FROM  " +
            "  start_sys_user_manage_dept ssum  " +
            "  INNER JOIN start_sys_user ssu ON ssu.id = ssum.user_id";
    @Select("select a.* from (" + USER_MANAGE_DEPT_SQL + ") a  ${ew.customSqlSegment}")
    Page<StartSysUserManageDeptVo> pageUserManage(@Param("page") Page<StartSysUserManageDeptVo> page, @Param("ew") Wrapper<StartSysUserManageDeptVo> wrapper);
}
